package com.wk.springboot.listener;

import java.util.List;
import org.springframework.batch.core.ItemWriteListener;
import org.springframework.stereotype.Component;

/**
 * @Classname MyItemWriterListener
 * @Description 写监听
 * 必须是core的类才可以
 * @Date 2020/3/31 13:41
 * @Author by weikai
 */
@Component
public class MyItemWriterListener implements ItemWriteListener {

  @Override
  public void beforeWrite(List items) {
    System.out.println("写之前");
  }

  @Override
  public void afterWrite(List items) {
    System.out.println("写之后");
  }

  @Override
  public void onWriteError(Exception exception, List items) {
    System.out.println("写报错哦");
  }
}
